package com.landinfo.service.dto;

import com.landinfo.domain.DashboardConfiguration;

import javax.persistence.Lob;
import java.io.Serializable;
import java.time.ZonedDateTime;
import java.util.LinkedHashSet;
import java.util.Objects;
import java.util.Set;

/**
 * A DTO for the DashboardConfiguration entity.
 */
public class DashboardConfigDTO implements Serializable {

    private String id;

    private String name;

    @Lob
    private String content;

    private Integer sorting;

    private String moduleName;

    private String parentId;

    private String remark;

    private String remark2;

    @Lob
    private String remark3;

    private ZonedDateTime createDateTime;

    private ZonedDateTime updateDateTime;

    private Set<DashboardConfiguration> children = new LinkedHashSet<DashboardConfiguration>();

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getModuleName() {
        return moduleName;
    }

    public void setModuleName(String moduleName) {
        this.moduleName = moduleName;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getRemark2() {
        return remark2;
    }

    public void setRemark2(String remark2) {
        this.remark2 = remark2;
    }

    public String getRemark3() {
        return remark3;
    }

    public void setRemark3(String remark3) {
        this.remark3 = remark3;
    }

    public ZonedDateTime getCreateDateTime() {
        return createDateTime;
    }

    public void setCreateDateTime(ZonedDateTime createDateTime) {
        this.createDateTime = createDateTime;
    }

    public ZonedDateTime getUpdateDateTime() {
        return updateDateTime;
    }

    public void setUpdateDateTime(ZonedDateTime updateDateTime) {
        this.updateDateTime = updateDateTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        DashboardConfigDTO dashboardConfigDTO = (DashboardConfigDTO) o;
        if (dashboardConfigDTO.getId() == null || getId() == null) {
            return false;
        }
        return Objects.equals(getId(), dashboardConfigDTO.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getId());
    }

    @Override
    public String toString() {
        return "DashboardConfigDTO{" +
            "id=" + getId() +
            ", name='" + getName() + "'" +
            ", content='" + getContent() + "'" +
            ", moduleName='" + getModuleName() + "'" +
            ", parentId='" + getParentId() + "'" +
            ", remark='" + getRemark() + "'" +
            ", remark2='" + getRemark2() + "'" +
            ", remark3='" + getRemark3() + "'" +
            ", createDateTime='" + getCreateDateTime() + "'" +
            ", updateDateTime='" + getUpdateDateTime() + "'" +
            "}";
    }

    public Integer getSorting() {
        return sorting;
    }

    public void setSorting(Integer sorting) {
        this.sorting = sorting;
    }

    public Set<DashboardConfiguration> getChildren() {
        return children;
    }

    public void setChildren(Set<DashboardConfiguration> children) {
        this.children = children;
    }
}
